package job.gfp.ranks_v2.init;

import java.io.IOException;

import mapred.SimpleJob;
import mapred.config.Compress;
import mapred.config.JobConfig;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.Reducer;
import org.apache.hadoop.mapred.RunningJob;

@SuppressWarnings("unchecked")
public class RanksV2_Initialize extends SimpleJob {

    public RanksV2_Initialize(String... settings)
            throws IOException {
        super("Ranks Initialize", settings);
        
        this.forceUserSetting("-reduce", 0);
    }

    @Override
    protected Class<? extends Reducer> getCombinerClass() {
        return null;
    }

    @Override
    protected Compress getCompress() {
        return Compress.GZIP;
    }

    @Override
    protected String[] getInputPaths(FileSystem fs) throws IOException {
        return new String[] { this.getUserSetting("-linkgraph") };
    }

    @Override
    protected Class<? extends Mapper> getMapperClass() {
        return RanksV2_Initialize_Mapper.class;
    }

    @Override
    protected String getOutputPath(FileSystem fs) throws IOException {
        return this.getUserSetting("-output") + "/Round_0";
    }

    @Override
    protected Class<? extends Reducer> getReducerClass() {
        return null;
    }

    @Override
    protected int getReducerNumber() {
        return 0;
    }

    @Override
    protected void setUp(JobConfig conf, FileSystem fs) throws IOException {
    }

    @Override
    protected void tearDown(JobConfig conf, FileSystem fs, RunningJob job)
            throws IOException {
    }
    
}
